home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume2 / util / suplib.2 < prev    next >
Text File  |  1988-10-22  |  56KB  |  2,316 lines

  1. Path: xanth!nic.MR.NET!hal!cwjcc!tut.cis.ohio-state.edu!bloom-beacon!husc6!bbn!ulowell!page
  2. From: page@swan.ulowell.edu (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v02i006:  suplib - Matt's support library, Part02/02
  5. Message-ID: <9766@swan.ulowell.edu>
  6. Date: 22 Oct 88 04:02:17 GMT
  7. Organization: University of Lowell, Computer Science Dept.
  8. Lines: 2305
  9. Approved: page@swan.ulowell.edu
  10.  
  11. Submitted-by: dillon@cory.berkeley.edu (Matt Dillon)
  12. Posting-number: Volume 2, Issue 6
  13. Archive-name: util/suplib.2
  14.  
  15. # This is a shell archive.  Remove anything before this line
  16. # then unpack it by saving it in a file and typing "sh file"
  17. # (Files unpacked will be owned by you and have default permissions).
  18. # This archive contains the following files:
  19. #    ./include/local/res.h
  20. #    ./include/local/ipc.h
  21. #    ./include/local/Makefile
  22. #    ./include/local/deemu.h
  23. #    ./include/local/typedefs.h
  24. #    ./include/local/xmisc.h
  25. #    ./include/local/file.i
  26. #    ./include/local/makesymbols.c
  27. #    ./include/local/dio.h
  28. #    ./suplib/mntreq.c
  29. #    ./suplib/bset.asm
  30. #    ./suplib/resetbreak.c
  31. #    ./suplib/scandir.c
  32. #    ./suplib/initdeemunw.c
  33. #    ./suplib/tags
  34. #    ./suplib/xfio.c
  35. #    ./suplib/closelibs.c
  36. #    ./suplib/wildcmp.c
  37. #    ./suplib/datetos.c
  38. #    ./suplib/checkbreak.c
  39. #    ./suplib/bcmp.asm
  40. #    ./suplib/bmov.asm
  41. #    ./suplib/semaphore.c
  42. #    ./suplib/llink.c
  43. #    ./suplib/openlibs.c
  44. #    ./suplib/dead.c
  45. #    ./suplib/getfont.c
  46. #    ./suplib/Makefile
  47. #    ./suplib/AUX/qint_test.c
  48. #    ./suplib/fhprintf.asm
  49. #
  50. if `test ! -d ./include`
  51. then
  52.   mkdir ./include
  53.   echo "mkdir ./include"
  54. fi
  55. if `test ! -d ./include/local`
  56. then
  57.   mkdir ./include/local
  58.   echo "mkdir ./include/local"
  59. fi
  60. if `test ! -s ./include/local/res.h`
  61. then
  62. echo "writing ./include/local/res.h"
  63. cat > ./include/local/res.h << '\Rogue\Monster\'
  64.  
  65. #define SHARABLE    0x0001  /*    shareable            */
  66. #define GLOBAL        0x0002  /*    global access            */
  67. #define NAMED        0x0004  /*    if shared, can access by name    */
  68. #define SWAPABLE    0x0008  /*    swap enabled            */
  69. #define LOCKED        0x0010  /*    locked into mem         */
  70.  
  71. #define SWAPPED     0x0100  /*    swapped to disk */
  72. #define SLOCKED     0x0200  /*    temporary lock    */
  73.  
  74. #define HAVHANDLE   0x0400  /*    have a filehndl */
  75. #define HAVLOCK     0x0800  /*    have a filelock */
  76.  
  77. #define RESMLNAME   "DRES"  /*  MemList node name   */
  78.  
  79. \Rogue\Monster\
  80. else
  81.   echo "will not over write ./include/local/res.h"
  82. fi
  83. if [ `wc -c ./include/local/res.h | awk '{printf $1}'` -ne 516 ]
  84. then
  85. echo `wc -c ./include/local/res.h | awk '{print "Got " $1 ", Expected " 516}'`
  86. fi
  87. if `test ! -s ./include/local/ipc.h`
  88. then
  89. echo "writing ./include/local/ipc.h"
  90. cat > ./include/local/ipc.h << '\Rogue\Monster\'
  91.  
  92. #ifndef LOCAL_TYPEDEFS_H
  93. #include <local/typedefs.h>
  94. #endif
  95.  
  96. #ifndef LOCAL_IPC_H
  97. #define LOCAL_IPC_H
  98.  
  99. #define IPCMSG    struct _IPCMSG
  100. #define IPCPORT struct _IPCPORT
  101.  
  102. IPCPORT {
  103.     PORT    Port;
  104.     long    Flags;    /*  Open flags for port */
  105. };
  106.  
  107. IPCMSG {
  108.     MSG     Msg;    /*  EXEC message header */
  109.     MNODE   ANode;    /*  Application node    */
  110.     long    Error;    /*  optional error code */
  111.     IPCPORT *ToPort;
  112.     void    (*Confirm)();
  113.  
  114.     APTR    TBuf;    /*  Sender Command    */
  115.     long    TLen;
  116.     long    TFlags;
  117.  
  118.     APTR    RBuf;    /*  Receiver Reply    */
  119.     long    RLen;
  120.     long    RFlags;
  121. };
  122.  
  123. #define IF_NOCOPY   0x0001    /*  Do allocate a copy of the buffer      */
  124. #define IF_ALLOC    0x0002    /*  Message was allocated          */
  125. #define IF_NOTFND   0x0004    /*  Command not found           (+IF_ERROR)*/
  126. #define IF_ERROR    0x0008    /*  Error occured              */
  127.  
  128. #define IF_NOAPP    0x0020    /*  Req. Application not found (+IF_ERROR)*/
  129. #define IF_GLOBAL   0x0040    /*  global message... sent to all servers */
  130. #define IF_ALLOCMSG 0x8000    /*  IPCMSG structure was allocated      */
  131.  
  132. #define PERR_NOMEM  1        /*  Ran out of memory parsing command      */
  133. #define PERR_NOVAR  2        /*  Could not find string variable      */
  134.  
  135. extern PORT *OpenIPC();
  136.  
  137. #endif
  138.  
  139.  
  140.  
  141. \Rogue\Monster\
  142. else
  143.   echo "will not over write ./include/local/ipc.h"
  144. fi
  145. if [ `wc -c ./include/local/ipc.h | awk '{printf $1}'` -ne 1223 ]
  146. then
  147. echo `wc -c ./include/local/ipc.h | awk '{print "Got " $1 ", Expected " 1223}'`
  148. fi
  149. if `test ! -s ./include/local/Makefile`
  150. then
  151. echo "writing ./include/local/Makefile"
  152. cat > ./include/local/Makefile << '\Rogue\Monster\'
  153.  
  154.  
  155. #   Make the precompiled symbol table
  156. #
  157. #   Warning: This makefile can be executed from ANY directory... paths
  158. #   must be absolute
  159.  
  160. all:
  161.     cc +L +Hinclude:symbols.m include:local/makesymbols.c -o ram:junk
  162.     -delete ram:junk
  163.  
  164. \Rogue\Monster\
  165. else
  166.   echo "will not over write ./include/local/Makefile"
  167. fi
  168. if [ `wc -c ./include/local/Makefile | awk '{printf $1}'` -ne 232 ]
  169. then
  170. echo `wc -c ./include/local/Makefile | awk '{print "Got " $1 ", Expected " 232}'`
  171. fi
  172. if `test ! -s ./include/local/deemu.h`
  173. then
  174. echo "writing ./include/local/deemu.h"
  175. cat > ./include/local/deemu.h << '\Rogue\Monster\'
  176.  
  177. #define DMSTRT    'ST','RT'
  178. #define DMEND    'EN','D '
  179. #define DMNW    'NW','  '
  180. #define DMTEXT    'TE','XT'
  181.  
  182. \Rogue\Monster\
  183. else
  184.   echo "will not over write ./include/local/deemu.h"
  185. fi
  186. if [ `wc -c ./include/local/deemu.h | awk '{printf $1}'` -ne 99 ]
  187. then
  188. echo `wc -c ./include/local/deemu.h | awk '{print "Got " $1 ", Expected " 99}'`
  189. fi
  190. if `test ! -s ./include/local/typedefs.h`
  191. then
  192. echo "writing ./include/local/typedefs.h"
  193. cat > ./include/local/typedefs.h << '\Rogue\Monster\'
  194.  
  195. /*
  196.  * TYPEDEFS.H
  197.  *
  198.  *    Feel free to add extern's that should be stuck in here... send
  199.  *    me the additions!
  200.  */
  201.  
  202. #ifndef LOCAL_TYPEDEFS_H
  203. #define LOCAL_TYPEDEFS_H
  204.  
  205. typedef unsigned char    ubyte;
  206. typedef unsigned short    uword;
  207. typedef unsigned long    ulong;
  208.  
  209. typedef struct MsgPort        PORT;
  210. typedef struct Message        MSG;
  211. typedef struct List        LIST;
  212. typedef struct Node        NODE;
  213. typedef struct MinList        MLIST;
  214. typedef struct MinNode        MNODE;
  215. typedef struct Device        DEV;
  216. typedef struct Library        LIB;
  217. typedef struct ExecBase     EXECBASE;
  218. typedef struct SignalSemaphore    SIGSEM;
  219. typedef struct Semaphore    SEM;
  220. typedef struct MemEntry     MEMENTRY;
  221. typedef struct MemList        MEMLIST;
  222. typedef struct MemHeader    MEMHEADER;
  223. typedef struct Interrupt    INTERRUPT;
  224. typedef struct Custom        CUST;
  225.  
  226. #define WINSTD    (WINDOWSIZING|WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE)
  227.  
  228. typedef struct BoolInfo     BOOLINFO;
  229. typedef struct Border        BORDER;
  230. typedef struct Gadget        GADGET;
  231. typedef struct Image        IMAGE;
  232. typedef struct IntuiMessage    IMESS;
  233. typedef struct IntuiText    ITEXT;
  234. typedef struct Menu        MENU;
  235. typedef struct MenuItem     ITEM;
  236. typedef struct NewScreen    NS;
  237. typedef struct NewWindow    NW;
  238. typedef struct Preferences    PREFS;
  239. typedef struct PropInfo     PROPINFO;
  240. typedef struct Remember     REMEMBER;
  241. typedef struct Requester    REQUESTER;
  242. typedef struct Screen        SCR;
  243. typedef struct StringInfo    STRINGINFO;
  244. typedef struct Window        WIN;
  245.  
  246. typedef struct copinit        COPINIT;
  247.  
  248. typedef struct GListEnv     GLISTENV;
  249. typedef struct GadgetInfo    GADGETINFO;
  250. typedef struct IBox        IBOX;
  251. typedef struct IntuitionBase    IBASE;
  252. typedef struct PenPair        PENPAIR;
  253. typedef struct Point        POINT;
  254.  
  255. typedef struct IOAudio        IOAUD;
  256.  
  257. typedef struct BootBlock    BOOTBLOCK;
  258.  
  259. typedef struct IOClipReq        IOCLIPREQ;
  260. typedef struct ClipboardUnitPartial CLIPUNIT;
  261. typedef struct SatisfyMsg        SATISFYMSG;
  262.  
  263. typedef struct ConUnit        CONUNIT;
  264. typedef struct IOStdReq     IOCON;
  265. typedef struct IOExtSer     IOSER;
  266.  
  267. typedef struct InputEvent    IE;
  268.  
  269. typedef struct TextAttr     TA;
  270. typedef struct TextFont     FONT;
  271. typedef struct Layer        LAYER;
  272. typedef struct Layer_Info    LAYERINFO;
  273. typedef struct Region        REGION;
  274. typedef struct ClipRect     CLIPRECT;
  275. typedef struct BitMap        BM;
  276. typedef struct RastPort     RP;
  277. typedef struct TmpRas        TMPRAS;
  278. typedef struct AreaInfo     AREAINFO;
  279. typedef struct View        VIEW;
  280. typedef struct ViewPort     VP;
  281. typedef struct ColorMap     CM;
  282. typedef struct GfxBase        GFXBASE;
  283.  
  284. typedef struct Process        PROC;
  285. typedef struct Task        TASK;
  286. typedef struct FileInfoBlock    FIB;
  287. typedef struct FileLock     LOCK;
  288. typedef struct DateStamp    DATESTAMP;
  289.  
  290. typedef struct timeval        TV;
  291. typedef struct timerequest    IOT;
  292.  
  293. typedef struct PrinterData    PD;
  294. typedef struct PrinterExtendedData PED;
  295.  
  296.  
  297. /*
  298.  *  Intuition
  299.  */
  300.  
  301. extern WIN    *OpenWindow();
  302. extern SCR    *OpenScreen();
  303. extern void    *AllocRemember();
  304. extern void    *ItemAddress();
  305. extern PREFS    *GetPrefs();
  306. extern PREFS    *GetDefPrefs();
  307. extern VIEW    *ViewAddress();
  308. extern VP    *ViewPortAddress();
  309.  
  310. /*
  311.  *  Graphics
  312.  */
  313.  
  314. extern void    *AllocRaster();
  315. extern TMPRAS    *InitTmpRas();
  316. extern AREAINFO *InitArea();
  317.  
  318. /*
  319.  *  Exec / Exec-Support
  320.  */
  321.  
  322. extern char    *GetDEnv();
  323. extern void    *GetMsg(), *RemHead(), *RemTail();
  324. extern void    *GetHead(), *GetTail(), *GetSucc(), *GetPred();
  325. extern void    *GetHeadOff(), *GetTailOff(), *GetSuccOff(), *GetPredOff();
  326. extern void    *OpenLibrary();
  327.  
  328. extern SIGSEM    *FindSemaphore();
  329. extern void    *AllocMem();
  330. extern void    *AllocEntry();
  331. extern PORT    *FindPort();
  332. extern PORT    *CreatePort();
  333. extern TASK    *CreateTask();
  334. extern INTERRUPT *SetIntVector();
  335. extern PROC    *CreateProc();
  336. extern void    *FindTask();    /*  task or proc    */
  337. extern LIB    *MakeLibrary();
  338.  
  339. extern FONT    *OpenFont();
  340. extern FONT    *OpenDiskFont();
  341.  
  342. extern void    *malloc();
  343.  
  344. extern void    *FindName2();
  345.  
  346. #endif
  347.  
  348.  
  349. \Rogue\Monster\
  350. else
  351.   echo "will not over write ./include/local/typedefs.h"
  352. fi
  353. if [ `wc -c ./include/local/typedefs.h | awk '{printf $1}'` -ne 3691 ]
  354. then
  355. echo `wc -c ./include/local/typedefs.h | awk '{print "Got " $1 ", Expected " 3691}'`
  356. fi
  357. if `test ! -s ./include/local/xmisc.h`
  358. then
  359. echo "writing ./include/local/xmisc.h"
  360. cat > ./include/local/xmisc.h << '\Rogue\Monster\'
  361.  
  362. /*
  363.  * XMISC.H
  364.  */
  365.  
  366. #ifndef MYLIB_XMISC_H
  367. #define MYLIB_XMISC_H
  368.  
  369. #define GRAPHICS_LIB        0x0001L
  370. #define INTUITION_LIB        0x0002L
  371. #define EXPANSION_LIB        0x0004L
  372. #define DISKFONT_LIB        0x0008L
  373. #define TRANSLATOR_LIB        0x0010L
  374. #define ICON_LIB        0x0020L
  375. #define MATH_LIB        0x0040L
  376. #define MATHTRANS_LIB        0x0080L
  377. #define MATHIEEEDOUBBAS_LIB 0x0100L
  378. #define MATHIEEESINGBAS_LIB 0x0200L
  379. #define LAYERS_LIB        0x0400L
  380. #define CLIST_LIB        0x0800L
  381. #define POTGO_LIB        0x1000L
  382. #define TIMER_LIB        0x2000L
  383. #define DRES_LIB        0x4000L
  384.  
  385. #define ADRLOCK struct _ADRLOCK
  386. #define XLIST struct _XLIST
  387.  
  388. ADRLOCK {
  389.     long    ad_Wait;
  390.     unsigned char  ad_Bits;
  391. };
  392.  
  393. XLIST {
  394.     XLIST *next;
  395.     XLIST **prev;
  396. };
  397.  
  398. #endif
  399.  
  400.  
  401. \Rogue\Monster\
  402. else
  403.   echo "will not over write ./include/local/xmisc.h"
  404. fi
  405. if [ `wc -c ./include/local/xmisc.h | awk '{printf $1}'` -ne 729 ]
  406. then
  407. echo `wc -c ./include/local/xmisc.h | awk '{print "Got " $1 ", Expected " 729}'`
  408. fi
  409. if `test ! -s ./include/local/file.i`
  410. then
  411. echo "writing ./include/local/file.i"
  412. cat > ./include/local/file.i << '\Rogue\Monster\'
  413.  
  414.         ;
  415.         ;
  416.         ;
  417.  
  418. LFF_NBLOCK    equ    $80000000
  419. LFF_REMOTE    equ    $40000000
  420.  
  421. LF_OPEN     equ    256
  422. LF_CLOSE    equ    257
  423. LF_DUP        equ    258
  424. LF_READ     equ    259
  425. LF_WRITE    equ    260
  426. LF_NREAD    equ    (261 | LFF_NBLOCK)
  427. LF_NWRITE    equ    (262 | LFF_NBLOCK)
  428. LF_RIOCTL    equ    263
  429. LF_RSIGNAL    equ    264
  430. LF_WSIGNAL    equ    265
  431. LF_SEEK     equ    266
  432. LF_WSIGMARK    equ    267
  433. LF_RSIGMARK    equ    268
  434. LF_GETBSIZE    equ    269
  435. LF_SETRBUF    equ    270
  436. LF_SETWBUF    equ    271
  437.  
  438. LF_OVRIDE    equ    272
  439. LF_UNRIDE    equ    273
  440.  
  441. \Rogue\Monster\
  442. else
  443.   echo "will not over write ./include/local/file.i"
  444. fi
  445. if [ `wc -c ./include/local/file.i | awk '{printf $1}'` -ne 423 ]
  446. then
  447. echo `wc -c ./include/local/file.i | awk '{print "Got " $1 ", Expected " 423}'`
  448. fi
  449. if `test ! -s ./include/local/makesymbols.c`
  450. then
  451. echo "writing ./include/local/makesymbols.c"
  452. cat > ./include/local/makesymbols.c << '\Rogue\Monster\'
  453.  
  454. #include <exec/types.h>
  455. #include <exec/alerts.h>
  456. #include <exec/devices.h>
  457. #include <exec/errors.h>
  458. #include <exec/exec.h>
  459. #include <exec/execbase.h>
  460. #include <exec/execname.h>
  461. #include <exec/interrupts.h>
  462. #include <exec/io.h>
  463. #include <exec/libraries.h>
  464. #include <exec/lists.h>
  465. #include <exec/memory.h>
  466. #include <exec/nodes.h>
  467. #include <exec/ports.h>
  468. #include <exec/resident.h>
  469. #include <exec/semaphores.h>
  470. #include <exec/tasks.h>
  471. #include <clib/macros.h>
  472. #include <devices/audio.h>
  473. #include <devices/bootblock.h>
  474. #include <devices/clipboard.h>
  475. #include <devices/console.h>
  476. #include <devices/conunit.h>
  477. #include <devices/gameport.h>
  478. #include <devices/input.h>
  479. #include <devices/inputevent.h>
  480. #include <devices/keyboard.h>
  481. #include <devices/keymap.h>
  482. #include <devices/narrator.h>
  483. #include <devices/parallel.h>
  484. #include <devices/printer.h>
  485. #include <devices/prtbase.h>
  486. #include <devices/serial.h>
  487. #include <devices/timer.h>
  488. #include <devices/trackdisk.h>
  489. #include <graphics/clip.h>
  490. #include <graphics/collide.h>
  491. #include <graphics/copper.h>
  492. #include <graphics/display.h>
  493. #include <graphics/gels.h>
  494. #include <graphics/gfx.h>
  495. #include <graphics/gfxbase.h>
  496. #include <graphics/gfxmacros.h>
  497. #include <graphics/graphint.h>
  498. #include <graphics/layers.h>
  499. #include <graphics/rastport.h>
  500. #include <graphics/regions.h>
  501. #include <graphics/sprite.h>
  502. #include <graphics/text.h>
  503. #include <graphics/view.h>
  504. #include <hardware/adkbits.h>
  505. #include <hardware/blit.h>
  506. #include <hardware/cia.h>
  507. #include <hardware/custom.h>
  508. #include <hardware/dmabits.h>
  509. #include <hardware/intbits.h>
  510. #include <intuition/intuition.h>
  511. #include <intuition/intuitionbase.h>
  512. #include <intuition/preferences.h>
  513. #include <intuition/screens.h>
  514. #include <libraries/configregs.h>
  515. #include <libraries/configvars.h>
  516. #include <libraries/diskfont.h>
  517. #include <libraries/dos.h>
  518. #include <libraries/dosextens.h>
  519. #include <libraries/expansion.h>
  520. #include <libraries/expansionbase.h>
  521. #include <libraries/filehandler.h>
  522. #include <libraries/mathffp.h>
  523. #include <libraries/romboot_base.h>
  524. #include <libraries/translator.h>
  525. #include <resources/cia.h>
  526. #include <resources/disk.h>
  527. #include <resources/misc.h>
  528. #include <resources/potgo.h>
  529. #include <workbench/icon.h>
  530. #include <workbench/startup.h>
  531. #include <workbench/workbench.h>
  532.  
  533. \Rogue\Monster\
  534. else
  535.   echo "will not over write ./include/local/makesymbols.c"
  536. fi
  537. if [ `wc -c ./include/local/makesymbols.c | awk '{printf $1}'` -ne 2270 ]
  538. then
  539. echo `wc -c ./include/local/makesymbols.c | awk '{print "Got " $1 ", Expected " 2270}'`
  540. fi
  541. if `test ! -s ./include/local/dio.h`
  542. then
  543. echo "writing ./include/local/dio.h"
  544. cat > ./include/local/dio.h << '\Rogue\Monster\'
  545.  
  546. /*
  547.  * DIO.H
  548.  *
  549.  *  (C)Copyright 1987 Matthew Dillon, All Rights Reserved
  550.  *  Freely distributable.  Donations welcome, I guess.
  551.  *
  552.  *    Matthew Dillon
  553.  *    891 Regal Rd.
  554.  *    Berkeley, Ca.    94708
  555.  *
  556.  */
  557.  
  558. #ifndef LOCAL_DIO_H
  559. #define LOCAL_DIO_H
  560. #include <exec/types.h>
  561. #include <exec/io.h>
  562. #include <exec/memory.h>
  563. #include <exec/ports.h>
  564. #include <devices/timer.h>
  565. #ifndef LOCAL_TYPEDEFS_H
  566. #include <local/typedefs.h>
  567. #endif
  568.  
  569. typedef struct IORequest IOR;
  570. typedef struct IOStdReq  STD;
  571.  
  572. /*
  573.  *    'to' is in microsections.  The IO request structure
  574.  *  pointer is optional to dio_open().  If NULL, dio_open()
  575.  *  initializes it's own IO request (to mostly zero).  You have
  576.  *  to provide an IO request structure, for instance, if openning
  577.  *  a console device since the window pointer must be passed to
  578.  *  OpenDevice().
  579.  *
  580.  *    each DFD descriptor has it's own signal.
  581.  *
  582.  *    dio_isdone() returns 1 if the channel is clear, 0 otherwise.
  583.  */
  584.  
  585. extern long dio_open();         /* dfd    = dio_open(devname,unit,flags,req)*/
  586. extern long dio_dup();          /* newdfd = dio_dup(dfd)    */
  587. extern STD *dio_ctl();          /* req  = dio_ctl(dfd,com,buf,len)          */
  588. extern STD *dio_ctl_to();       /* req  = dio_ctl_to(dfd,com,buf,len,to)    */
  589. extern STD *dio_wait();         /* req  = dio_wait(dfd)     */
  590. extern STD *dio_abort();        /* req  = dio_abort(dfd)    */
  591. extern STD *dio_isdone();       /* req  = dio_isdone(dfd)   */
  592. extern int dio_signal();        /* signm= dio_signal(dfd)   */
  593. extern void dio_close();        /*  dio_close(dfd)          */
  594. extern void dio_cloesgroup();   /*  dio_closegroup(dfd)     */
  595. extern void dio_cact();         /*  dio_cact(dfd,bool)      */
  596.  
  597.  
  598.  
  599. /*
  600.  * dio_simple() and related macros return the !io_Error field. That
  601.  * is, 0=ERROR, 1=OK
  602.  *
  603.  * dio_actual() returns the io_Actual field.
  604.  *
  605.  * NOTE: the io_Actual field may not be set by the device if an
  606.  * error condition exists.  To make the io_ctl() and io_ctl_to()
  607.  * call automatically clear the io_Actual field before doing the
  608.  * io operation, use the DIO_CACT() call.  The reason this isn't
  609.  * done automatically by default is that some devices require
  610.  * parameters to be passed in the io_Actual field (like the
  611.  * timer.device).
  612.  *
  613.  *  Remember, Asyncronous IO is done by sending -com instead of com.
  614.  *
  615.  *    CALL                Syncronous IO   Asyncronous IO
  616.  *
  617.  *  dio_simple(dfd,com)             0=ERROR, 1=OK   undefined
  618.  *  dio_actual(dfd,com)             io_Actual       undefined
  619.  *  dio_reset(dfd)                  0=ERROR, 1=OK   n/a
  620.  *  dio_update(dfd)                 0=ERROR, 1=OK   n/a
  621.  *  dio_clear(dfd)                  0=ERROR, 1=OK   n/a
  622.  *  dio_stop(dfd)                   0=ERROR, 1=OK   n/a
  623.  *  dio_start(dfd)                  0=ERROR, 1=OK   n/a
  624.  *  dio_flush(dfd)                  0=ERROR, 1=OK   n/a
  625.  *  dio_getreq(dfd)                 returns a ptr to the IO
  626.  *                    request structure
  627.  *  NOTE: If you use the following, you probably want to have the
  628.  *  device library automatically clear the io_Actual field before
  629.  *  sending the request so you get 0 if an error occurs.  That
  630.  *  is: dio_cact(dfd,1);
  631.  *
  632.  *
  633.  *  dio_read(dfd,buf,len)           returns actual bytes read
  634.  *  dio_write(dfd,buf,len)          returns actual bytes written
  635.  *
  636.  *    The timeout argument for dio_readto() and dio_writeto()
  637.  *    is in MICROSECONDS, up to 2^31uS.
  638.  *
  639.  *  dio_readto(dfd,buf,len,to)      returns actual bytes read
  640.  *  dio_writeto(dfd,buf,len,to)     returns actual bytes written
  641.  *
  642.  *    The asyncronous dio_reada() and dio_writea() do not
  643.  *    return anything.
  644.  *
  645.  *  dio_reada(dfd,buf,len)          begin asyncronous read
  646.  *  dio_writea(dfd,buf,len)         begin asyncronous write
  647.  */
  648.  
  649. #define dio_mask(dfd)           (1 << dio_signal(dfd))
  650.  
  651. #define dio_simple(dfd,com)     (!dio_ctl(dfd,com,0,0)->io_Error)
  652. #define dio_actual(dfd,com)     ( dio_ctl(dfd,com,0,0)->io_Actual)
  653. #define dio_reset(dfd)          dio_simple(dfd,CMD_RESET)
  654. #define dio_update(dfd)         dio_simple(dfd,CMD_UPDATE)
  655. #define dio_clear(dfd)          dio_simple(dfd,CMD_CLEAR)
  656. #define dio_stop(dfd)           dio_simple(dfd,CMD_STOP)
  657. #define dio_start(dfd)          dio_simple(dfd,CMD_START)
  658. #define dio_flush(dfd)          dio_simple(dfd,CMD_FLUSH)
  659. #define dio_getreq(dfd)         dio_ctl(dfd,0,0,0)
  660.  
  661. #define dio_read(dfd,buf,len)       (dio_ctl(dfd,CMD_READ,buf,len)->io_Actual)
  662. #define dio_write(dfd,buf,len)      (dio_ctl(dfd,CMD_WRITE,buf,len)->io_Actual)
  663. #define dio_readto(dfd,buf,len,to)  (dio_ctl_to(dfd,CMD_READ,buf,len,to)->io_Actual)
  664. #define dio_writeto(dfd,buf,len,to) (dio_ctl_to(dfd,CMD_WRITE,buf,len,to)->io_Actual)
  665. #define dio_reada(dfd,buf,len)      ((void)dio_ctl(dfd,-CMD_READ,buf,len))
  666. #define dio_writea(dfd,buf,len)     ((void)dio_ctl(dfd,-CMD_WRITE,buf,len))
  667.  
  668. #endif
  669.  
  670.  
  671. \Rogue\Monster\
  672. else
  673.   echo "will not over write ./include/local/dio.h"
  674. fi
  675. if [ `wc -c ./include/local/dio.h | awk '{printf $1}'` -ne 4754 ]
  676. then
  677. echo `wc -c ./include/local/dio.h | awk '{print "Got " $1 ", Expected " 4754}'`
  678. fi
  679. if `test ! -d ./suplib`
  680. then
  681.   mkdir ./suplib
  682.   echo "mkdir ./suplib"
  683. fi
  684. if `test ! -s ./suplib/mntreq.c`
  685. then
  686. echo "writing ./suplib/mntreq.c"
  687. cat > ./suplib/mntreq.c << '\Rogue\Monster\'
  688.  
  689. extern struct Process *FindTask();
  690.  
  691. mountrequest(bool)
  692. {
  693.     static APTR original_pr_WindowPtr;
  694.     register struct Process *proc;
  695.  
  696.     proc = FindTask(0);
  697.     if (!bool && proc->pr_WindowPtr != (APTR)-1) {
  698.     original_pr_WindowPtr = proc->pr_WindowPtr;
  699.     proc->pr_WindowPtr = (APTR)-1;
  700.     }
  701.     if (bool && proc->pr_WindowPtr == (APTR)-1)
  702.     proc->pr_WindowPtr = original_pr_WindowPtr;
  703. }
  704.  
  705.  
  706. \Rogue\Monster\
  707. else
  708.   echo "will not over write ./suplib/mntreq.c"
  709. fi
  710. if [ `wc -c ./suplib/mntreq.c | awk '{printf $1}'` -ne 388 ]
  711. then
  712. echo `wc -c ./suplib/mntreq.c | awk '{print "Got " $1 ", Expected " 388}'`
  713. fi
  714. if `test ! -s ./suplib/bset.asm`
  715. then
  716. echo "writing ./suplib/bset.asm"
  717. cat > ./suplib/bset.asm << '\Rogue\Monster\'
  718.  
  719.         public    _bzero        ; Zero a block of memory
  720.         public    _bset        ; Set a block of memory to (byte val)
  721.  
  722.         ;   BSET(buffer, len, byte)
  723.         ;   BZERO(buffer, len)
  724.  
  725.         public    _bset
  726.         public    _bzero
  727.  
  728. _bzero:     moveq.l #0,D1
  729.         bra    .bz0
  730. _bset:        move.b    12+3(sp),D1
  731. .bz0        move.l    4(sp),A0
  732.         move.l    8(sp),D0
  733.  
  734.         add.l    D0,A0        ; start at end of address
  735.         cmp.l    #40,D0        ; unscientifically chosen
  736.         bls    .bs2
  737.         bra    .bs10
  738. .bs1        move.b    D1,-(A0)    ; any count < 65536
  739. .bs2        dbf    D0,.bs1
  740.         rts
  741.  
  742.                     ; at least 2 bytes in count (D0)
  743. .bs10        movem.l D2-D7/A2-A6,-(sp)   ;ant count > 4
  744.         move.l    A0,D2
  745.         btst.l    #0,D2        ; is it aligned?
  746.         beq    .bs22
  747.         move.b    D1,-(A0)    ; no, copy one byte
  748.         subq.l    #1,D0
  749.  
  750. .bs22        andi.l    #$FF,D1     ; expand data D1.B -> D2-D7/A1-A6
  751.         move.l    D1,D2        ; D1 000000xx   D2 000000xx
  752.         asl.w    #8,D2        ;               0000xx00
  753.         or.w    D2,D1        ;     0000xxxx
  754.         move.w    D1,D2        ;     0000xxxx      0000xxxx
  755.         swap    D2        ;     0000xxxx      xxxx0000
  756.         or.l    D1,D2        ; D2.L
  757.         move.l    D2,D3
  758.         move.l    D2,D4
  759.         move.l    D2,D5
  760.         move.l    D2,D6
  761.         move.l    D2,D7
  762.         move.l    D2,A1
  763.         move.l    D2,A2
  764.         move.l    D2,A3
  765.         move.l    D2,A4
  766.         move.l    D2,A5
  767.         move.l    D2,A6        ; D2-D7/A1-A6   (12 registers)
  768.         move.l    #12*4,D1    ; bytes per transfer (48)
  769. .bs30        sub.l    D1,D0        ; pre subtract
  770.         bmi    .bs40
  771. .bs31        movem.l D2-D7/A1-A6,-(A0)
  772.         sub.l    D1,D0
  773.         bpl    .bs31
  774. .bs40        add.w    D1,D0        ; less than 48 bytes remaining
  775.  
  776.         move.w    #4,D1        ; by 4's
  777.         sub.w    D1,D0
  778.         bmi    .bs50
  779. .bs41        move.l    D2,-(A0)
  780.         sub.w    D1,D0
  781.         bpl    .bs41
  782. .bs50        add.w    D1,D0
  783.         bra    .bs52
  784. .bs51        move.b    D2,-(A0)    ; by 1's
  785. .bs52        dbf    D0,.bs51
  786.         movem.l (sp)+,D2-D7/A2-A6
  787.         rts
  788.  
  789. \Rogue\Monster\
  790. else
  791.   echo "will not over write ./suplib/bset.asm"
  792. fi
  793. if [ `wc -c ./suplib/bset.asm | awk '{printf $1}'` -ne 1598 ]
  794. then
  795. echo `wc -c ./suplib/bset.asm | awk '{print "Got " $1 ", Expected " 1598}'`
  796. fi
  797. if `test ! -s ./suplib/resetbreak.c`
  798. then
  799. echo "writing ./suplib/resetbreak.c"
  800. cat > ./suplib/resetbreak.c << '\Rogue\Monster\'
  801.  
  802. /*
  803.  * reset the break signal and return the break status
  804.  */
  805.  
  806. #define SBF (SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D)
  807.  
  808. resetbreak()
  809. {
  810.     return(SetSignal(0,SBF) & SBF);
  811. }
  812.  
  813. \Rogue\Monster\
  814. else
  815.   echo "will not over write ./suplib/resetbreak.c"
  816. fi
  817. if [ `wc -c ./suplib/resetbreak.c | awk '{printf $1}'` -ne 166 ]
  818. then
  819. echo `wc -c ./suplib/resetbreak.c | awk '{print "Got " $1 ", Expected " 166}'`
  820. fi
  821. if `test ! -s ./suplib/scandir.c`
  822. then
  823. echo "writing ./suplib/scandir.c"
  824. cat > ./suplib/scandir.c << '\Rogue\Monster\'
  825.  
  826. /*
  827.  *  SCANDIR.C
  828.  *
  829.  *  SD {
  830.  *    SD *next;
  831.  *    char buf[];
  832.  *  };
  833.  *
  834.  *  SD *sd;
  835.  *
  836.  *  sd = ScanDir(dir, match)
  837.  *     FreeDirScan(sd)
  838.  */
  839.  
  840. #include <local/typedefs.h>
  841.  
  842. #define SD  struct _SD
  843. #define DBLK    32
  844. #define ALIGNL(ptr) (void *)(((long)ptr + 3) & ~3)
  845.  
  846. SD {
  847.     SD        *next;
  848.     char    buf[4];
  849. };
  850.  
  851. /*BREAKUP   ScanDir.c    */
  852. SD *
  853. ScanDir(dir, match, abortflag)
  854. char *dir, *match;
  855. char *abortflag;
  856. {
  857.     char buf[sizeof(FIB)+3];
  858.     register FIB *fib = ALIGNL(buf);
  859.     register SD  *sd;
  860.     SD    *sbase;
  861.     long lock;
  862.     char ok = 0;
  863.  
  864.     geta4();
  865.     sd = (SD *)&sbase;
  866.     lock = Lock(dir, SHARED_LOCK);
  867.     if (lock && Examine(lock, fib) && fib->fib_DirEntryType > 0) {
  868.     while (ExNext(lock, fib)) {
  869.         if (*abortflag)
  870.         break;
  871.         if (wildcmp(match, fib->fib_FileName)) {
  872.         sd->next = AllocMem(sizeof(SD) - 3 + strlen(fib->fib_FileName), MEMF_PUBLIC);
  873.         sd = sd->next;
  874.         strcpy(sd->buf, fib->fib_FileName);
  875.         }
  876.     }
  877.     UnLock(lock);
  878.     sd->next = NULL;
  879.     return(sbase);
  880.     }
  881.     if (lock)
  882.     UnLock(lock);
  883.     return(NULL);
  884. }
  885.  
  886. /*BREAKUP   FreeDirScan.c   */
  887. void
  888. FreeDirScan(sd)
  889. register SD *sd;
  890. {
  891.     register SD *nextsd;
  892.  
  893.     geta4();
  894.     while (sd) {
  895.     nextsd = sd->next;
  896.     FreeMem(sd, sizeof(SD) - 3 + strlen(sd->buf));
  897.     sd = nextsd;
  898.     }
  899. }
  900.  
  901. \Rogue\Monster\
  902. else
  903.   echo "will not over write ./suplib/scandir.c"
  904. fi
  905. if [ `wc -c ./suplib/scandir.c | awk '{printf $1}'` -ne 1250 ]
  906. then
  907. echo `wc -c ./suplib/scandir.c | awk '{print "Got " $1 ", Expected " 1250}'`
  908. fi
  909. if `test ! -s ./suplib/initdeemunw.c`
  910. then
  911. echo "writing ./suplib/initdeemunw.c"
  912. cat > ./suplib/initdeemunw.c << '\Rogue\Monster\'
  913.  
  914. /*
  915.  *  DEEMU NW structure auto init.
  916.  *
  917.  *  Intuition must be openned.
  918.  */
  919.  
  920. typedef struct NewWindow NW;
  921. typedef struct Screen     SCR;
  922.  
  923. InitDeemuNW(ary, nw)
  924. register short *ary;
  925. register NW *nw;
  926. {
  927.     register short alen = ary[3];
  928.     SCR Scr;
  929.  
  930.     if (GetScreenData(&Scr, sizeof(Scr), nw->Type, nw->Screen) == 0) {
  931.     Scr.Width = 320;
  932.     Scr.Height= 200;
  933.     }
  934.     if (alen >= 8) {
  935.     if ((nw->Width   = ary[6]) < 0)
  936.         nw->Width += Scr.Width;
  937.     if ((nw->Height  = ary[7]) < 0)
  938.         nw->Height+= Scr.Height;
  939.     }
  940.     if (alen >= 4) {
  941.     if ((nw->LeftEdge= ary[4]) < 0)
  942.         nw->LeftEdge += Scr.Width - nw->Width;
  943.     if ((nw->TopEdge = ary[5]) < 0)
  944.         nw->TopEdge += Scr.Height - nw->Height;
  945.     }
  946.     if (nw->LeftEdge < 0 || nw->TopEdge < 0 || nw->Width < 0 || nw->Height < 0 ||
  947.     nw->LeftEdge + nw->Width > Scr.Width || nw->TopEdge + nw->Height > Scr.Height) {
  948.  
  949.     nw->LeftEdge = nw->TopEdge = 0;
  950.     nw->Width = 320;
  951.     nw->Height= 100;
  952.     }
  953.     if (alen >= 9)
  954.     nw->DetailPen = ary[8] >> 8;
  955.     if (alen >= 10)
  956.     nw->BlockPen  = ary[8];
  957. }
  958.  
  959.  
  960. \Rogue\Monster\
  961. else
  962.   echo "will not over write ./suplib/initdeemunw.c"
  963. fi
  964. if [ `wc -c ./suplib/initdeemunw.c | awk '{printf $1}'` -ne 1029 ]
  965. then
  966. echo `wc -c ./suplib/initdeemunw.c | awk '{print "Got " $1 ", Expected " 1029}'`
  967. fi
  968. if `test ! -s ./suplib/tags`
  969. then
  970. echo "writing ./suplib/tags"
  971. cat > ./suplib/tags << '\Rogue\Monster\'
  972. NewAsyncOp asyncop.c /^NewAsyncOp(
  973. StartAsyncOp asyncop.c /^StartAsyncOp(
  974. CheckAsyncOp asyncop.c /^CheckAsyncOp(
  975. WaitAsyncOp asyncop.c /^WaitAsyncOp(
  976. CloseAsyncOp asyncop.c /^CloseAsyncOp(
  977. asyhandler asyncop.c /^asyhandler(
  978. disablebreak break.c /^disablebreak(
  979. enablebreak break.c /^enablebreak(
  980. checkbreak checkbreak.c /^checkbreak(
  981. GetConWindow conwin.c /^GetConWindow(
  982. datetos datetos.c /^datetos(
  983. dio_open dio.c /^dio_open(
  984. dio_dfm dio.c /^dio_dfm(
  985. dio_ddl dio.c /^dio_ddl(
  986. dio_cact dio.c /^dio_cact(
  987. dio_close dio.c /^dio_close(
  988. dio_closegroup dio.c /^dio_closegroup(
  989. dio_dup dio.c /^dio_dup(
  990. dio_signal dio.c /^dio_signal(
  991. dio_flags dio.c /^dio_flags(
  992. dio_ctl_to dio.c /^dio_ctl_to(
  993. dio_ctl dio.c /^dio_ctl(
  994. dio_isdone dio.c /^dio_isdone(
  995. dio_wait dio.c /^dio_wait(
  996. dio_abort dio.c /^dio_abort(
  997. llink llink.c /^llink(
  998. lunlink lunlink.c /^lunlink(
  999. mountrequest mntreq.c /^mountrequest(
  1000. openlibs openlibs.c /^openlibs(
  1001. closelibs openlibs.c /^closelibs(
  1002. resetbreak resetbreak.c /^resetbreak(
  1003. ScanDir scandir.c /^ScanDir(
  1004. FreeDirScan scandir.c /^FreeDirScan(
  1005. setfiledate setfiledate.c /^setfiledate(
  1006. wildcmp wildcmp.c /^wildcmp(
  1007. xfopen xfio.c /^xfopen(
  1008. xfclose xfio.c /^xfclose(
  1009. xfgets xfio.c /^xfgets(
  1010. xfread xfio.c /^xfread(
  1011. xfwrite xfio.c /^xfwrite(
  1012. xfstartasync xfio.c /^xfstartasync(
  1013. bcmp bcmp.asm /^_bcmp
  1014. bset bset.asm /^_bset
  1015. bmov bmov.asm /^_bmov
  1016. bzero bset.asm /^_bzero
  1017. fhprintf fhprintf.asm /^_fhprintf
  1018. AutoAllocMiscResource resource.asm /^_AutoAllocMiscResource
  1019. AutoFreeMiscResource /^_AutoFreeMiscResource
  1020.  
  1021.  
  1022. \Rogue\Monster\
  1023. else
  1024.   echo "will not over write ./suplib/tags"
  1025. fi
  1026. if [ `wc -c ./suplib/tags | awk '{printf $1}'` -ne 1522 ]
  1027. then
  1028. echo `wc -c ./suplib/tags | awk '{print "Got " $1 ", Expected " 1522}'`
  1029. fi
  1030. if `test ! -s ./suplib/xfio.c`
  1031. then
  1032. echo "writing ./suplib/xfio.c"
  1033. cat > ./suplib/xfio.c << '\Rogue\Monster\'
  1034.  
  1035. /*
  1036.  *  XFIO.C
  1037.  *
  1038.  *  Simple File IO with asyncronous READ and WRITE capability
  1039.  *  Perfect for protocol transfer applications
  1040.  *
  1041.  *  xfi = xfopen(name, modes, bufsize)    ("r", "w", "w+")
  1042.  *   n    = xfread(xfi, buf, bytes)   ASYNCRONOUS READ
  1043.  *  err = xfwrite(xfi, buf, bytes)  ASYNCRONOUS WRITE
  1044.  *  err = xfclose(xfi)
  1045.  *
  1046.  *  RESTRICTIONS:   NO seeking.  You can do one of xfread() or xfwrite()
  1047.  *  for a given open XFIle handle (not both).
  1048.  *
  1049.  *  xfwrite() returns a cumulative error (once an error occurs, it will not
  1050.  *  do any more writes).  xfclose() returns the cumulative write error
  1051.  *  (since the last write may have been asyncronous and thus the error
  1052.  *  unknown at the time).
  1053.  *
  1054.  *  Two buffers are created each bufsize/2 bytes in size.  for writing,
  1055.  *  one buffers is sent asyncronously while the other fills.  For reading,
  1056.  *  one buffer is filling while the other is being read.
  1057.  */
  1058.  
  1059. #define XFI        struct _XFI
  1060. #define XFBUF        struct _XFBUF
  1061. #define MSGPORT     struct MsgPort
  1062. #define FH        struct FileHandle
  1063. #define STDPKT        struct StandardPacket
  1064.  
  1065.  
  1066. XFBUF {
  1067.     long   bufsize;
  1068.     long   idx;
  1069.     long   max;
  1070.     char    buf[4];    /*  actually bufsize bytes long */
  1071. };
  1072.  
  1073. XFI {
  1074.     char    ro;     /*  read only, else write only    */
  1075.     char    pend;    /*  packet pending        */
  1076.     char    err;    /*  cumulative error        */
  1077.     char    reserved;
  1078.     XFBUF   *asbuf;
  1079.     XFBUF   *usbuf;
  1080.     FH        *fh;
  1081.     STDPKT  sp;     /*  asyncronous message     */
  1082.     MSGPORT rp;     /*  reply port for pending pkts */
  1083. };
  1084.  
  1085. extern FH *Open();
  1086. extern void *malloc(), *FindTask();
  1087.  
  1088. void *
  1089. xfopen(file, mode, bytes)
  1090. char *file;
  1091. char *mode;
  1092. {
  1093.     register XFI *xfi = malloc(sizeof(XFI));
  1094.     register long nbytes = bytes >> 1;
  1095.     int ap = 0;
  1096.  
  1097.     bzero(xfi, sizeof(XFI));
  1098.     if (mode[0] == 'w') {
  1099.     if (mode[1] == '+') {
  1100.         ap = 1;
  1101.         if ((xfi->fh = Open(file, 1005)) == NULL)
  1102.         xfi->fh = Open(file, 1006);
  1103.         goto ok;
  1104.     }
  1105.     xfi->fh = Open(file, 1006);
  1106.     goto ok;
  1107.     }
  1108.     xfi->fh = Open(file, 1005);
  1109. ok:
  1110.     if (xfi->fh) {
  1111.     if (ap)
  1112.         Seek(xfi->fh, 0, 1);
  1113.     xfi->fh = (FH *)((long)xfi->fh << 2);
  1114.     xfi->asbuf = malloc(sizeof(XFBUF) + nbytes);    /* a little more    */
  1115.     xfi->usbuf = malloc(sizeof(XFBUF) + nbytes);    /* then we need     */
  1116.     bzero(xfi->asbuf, sizeof(XFBUF));
  1117.     bzero(xfi->usbuf, sizeof(XFBUF));
  1118.     xfi->ro = (mode[0] == 'r');
  1119.     xfi->asbuf->bufsize = xfi->usbuf->bufsize = nbytes;
  1120.     xfi->rp.mp_Node.ln_Type = NT_MSGPORT;
  1121.     xfi->rp.mp_Node.ln_Name = "XFIO-Async";
  1122.     xfi->rp.mp_Flags = PA_SIGNAL;
  1123.     xfi->rp.mp_SigBit = AllocSignal(-1);
  1124.     xfi->rp.mp_SigTask = FindTask(NULL);
  1125.     NewList(&xfi->rp.mp_MsgList);
  1126.     if (xfi->ro)
  1127.         xfstartasync(xfi, ACTION_READ);
  1128.     } else {
  1129.     free(xfi);
  1130.     xfi = NULL;
  1131.     }
  1132.     return(xfi);
  1133. }
  1134.  
  1135. xfclose(xfi)
  1136. register XFI *xfi;
  1137. {
  1138.     int err = 1;
  1139.     if (xfi) {
  1140.     if (xfi->pend) {
  1141.         xfi->pend = 0;
  1142.         WaitPort (&xfi->rp);
  1143.         GetMsg   (&xfi->rp);
  1144.     }
  1145.     if (!xfi->ro && xfi->usbuf->idx)
  1146.         Write((long)xfi->fh >> 2, xfi->usbuf->buf, xfi->usbuf->idx);
  1147.     err = xfi->err;
  1148.     Close((long)xfi->fh >> 2);
  1149.     free(xfi->asbuf);
  1150.     free(xfi->usbuf);
  1151.     FreeSignal(xfi->rp.mp_SigBit);
  1152.     free(xfi);
  1153.     }
  1154.     return(err);
  1155. }
  1156.  
  1157. xfgets(xfi, buf, n)
  1158. XFI *xfi;
  1159. char *buf;
  1160. {
  1161.     register XFBUF *usbuf = xfi->usbuf;
  1162.     register int i, idx;
  1163.     if (!xfi->ro)
  1164.     return(-1);
  1165.     --n;
  1166.     for (i = 0;;) {
  1167.     for (idx = usbuf->idx; idx < usbuf->max && i < n; ++idx, ++i) {
  1168.         if ((buf[i] = usbuf->buf[idx]) == '\n') {
  1169.         buf[i] = 0;
  1170.         usbuf->idx = idx+1;
  1171.         return(i);
  1172.         }
  1173.     }
  1174.     usbuf->idx = idx;
  1175.     buf[i] = 0;
  1176.     if (i == n)
  1177.         return(i);
  1178.     if (xfi->pend == 0)                /* EOF        */
  1179.         return(-1);
  1180.     WaitPort (&xfi->rp);
  1181.     GetMsg     (&xfi->rp);
  1182.     xfi->pend = 0;
  1183.     if (xfi->sp.sp_Pkt.dp_Res1 <= 0) {        /* EOF        */
  1184.         if (i == 0)
  1185.         return(-1);
  1186.         return(i);
  1187.     }
  1188.     xfi->asbuf->max = xfi->sp.sp_Pkt.dp_Res1;
  1189.     xfi->asbuf->idx = 0;
  1190.     usbuf = xfi->asbuf;                /* swap bufs*/
  1191.     xfi->asbuf = xfi->usbuf;
  1192.     xfi->usbuf = usbuf;
  1193.     xfstartasync(xfi, ACTION_READ);         /* new async*/
  1194.     }
  1195. }
  1196.  
  1197.  
  1198. xfread(xfi, buf, n)
  1199. XFI *xfi;
  1200. char *buf;
  1201. {
  1202.     register XFBUF *usbuf = xfi->usbuf;
  1203.     register int orig = n;
  1204.     register int diff;
  1205.  
  1206.     if (!xfi->ro)
  1207.     return(0);
  1208.     while ((diff = usbuf->max - usbuf->idx) < n) {
  1209.     movmem(usbuf->buf + usbuf->idx, buf, diff);    /* copy entire buf */
  1210.     buf += diff;
  1211.     n -= diff;
  1212.     if (xfi->pend == 0) {
  1213.         xfi->usbuf->idx = xfi->usbuf->max;
  1214.         return(orig - n);
  1215.     }
  1216.     WaitPort (&xfi->rp);
  1217.     GetMsg     (&xfi->rp);
  1218.     xfi->pend = 0;
  1219.     if (xfi->sp.sp_Pkt.dp_Res1 <= 0) {        /* EOF        */
  1220.         xfi->usbuf->idx = xfi->usbuf->max;
  1221.         return(orig - n);
  1222.     }
  1223.     xfi->asbuf->max = xfi->sp.sp_Pkt.dp_Res1;
  1224.     xfi->asbuf->idx = 0;
  1225.     usbuf = xfi->asbuf;                /* swap bufs*/
  1226.     xfi->asbuf = xfi->usbuf;
  1227.     xfi->usbuf = usbuf;
  1228.     xfstartasync(xfi, ACTION_READ);         /* new async*/
  1229.     }
  1230.     movmem(usbuf->buf + usbuf->idx, buf, n);
  1231.     usbuf->idx += n;
  1232.     return(orig);
  1233. }
  1234.  
  1235. xfwrite(xfi, buf, n)
  1236. XFI *xfi;
  1237. char *buf;
  1238. {
  1239.     register XFBUF *usbuf = xfi->usbuf;
  1240.     register int diff;
  1241.  
  1242.     if (xfi->ro || xfi->err)
  1243.     return(1);
  1244.     while ((diff = usbuf->bufsize - usbuf->idx) < n) {
  1245.     movmem(buf, usbuf->buf + usbuf->idx, diff);    /*  copy buf    */
  1246.     buf += diff;
  1247.     n -= diff;
  1248.     if (xfi->pend) {
  1249.         WaitPort(&xfi->rp);
  1250.         GetMsg  (&xfi->rp);
  1251.         xfi->pend = 0;
  1252.         if (xfi->sp.sp_Pkt.dp_Res1 != xfi->sp.sp_Pkt.dp_Arg3) {
  1253.         xfi->err = 1;
  1254.         return(1);
  1255.         }
  1256.     }
  1257.     usbuf = xfi->asbuf;
  1258.     xfi->asbuf = xfi->usbuf;
  1259.     xfi->usbuf = usbuf;
  1260.     usbuf->idx = 0;
  1261.     xfstartasync(xfi, ACTION_WRITE);
  1262.     }
  1263.     movmem(buf, usbuf->buf + usbuf->idx, n);
  1264.     usbuf->idx += n;
  1265.     return(xfi->err);
  1266. }
  1267.  
  1268. static
  1269. xfstartasync(xfi, action)
  1270. register XFI *xfi;
  1271. {
  1272.     xfi->sp.sp_Msg.mn_Node.ln_Name = (char *)&(xfi->sp.sp_Pkt);
  1273.     xfi->sp.sp_Pkt.dp_Link = &(xfi->sp.sp_Msg);
  1274.     xfi->sp.sp_Pkt.dp_Port = &xfi->rp;
  1275.     xfi->sp.sp_Pkt.dp_Type = action;
  1276.     xfi->sp.sp_Pkt.dp_Arg1 = xfi->fh->fh_Arg1;
  1277.     xfi->sp.sp_Pkt.dp_Arg2 = (long)xfi->asbuf->buf;
  1278.     xfi->sp.sp_Pkt.dp_Arg3 = xfi->asbuf->bufsize;
  1279.     PutMsg (xfi->fh->fh_Type, &xfi->sp);
  1280.     xfi->pend = 1;
  1281. }
  1282.  
  1283.  
  1284. \Rogue\Monster\
  1285. else
  1286.   echo "will not over write ./suplib/xfio.c"
  1287. fi
  1288. if [ `wc -c ./suplib/xfio.c | awk '{printf $1}'` -ne 5958 ]
  1289. then
  1290. echo `wc -c ./suplib/xfio.c | awk '{print "Got " $1 ", Expected " 5958}'`
  1291. fi
  1292. if `test ! -s ./suplib/closelibs.c`
  1293. then
  1294. echo "writing ./suplib/closelibs.c"
  1295. cat > ./suplib/closelibs.c << '\Rogue\Monster\'
  1296.  
  1297. /*
  1298.  * CLOSELIBS(mask)
  1299.  *
  1300.  *    Close the indicated libraries.    Does not close libraries which
  1301.  *    have not been openned.
  1302.  */
  1303.  
  1304. #include "xmisc.h"
  1305.  
  1306. extern struct OLI strvar[];
  1307.  
  1308. closelibs(mask)
  1309. register unsigned short mask;
  1310. {
  1311.     register struct OLI *sv;
  1312.  
  1313.     for (sv = &strvar[0]; mask && sv->name; mask >>= 1, ++sv){
  1314.     if ((mask & 1) && *sv->var) {
  1315.         CloseLibrary(*sv->var);
  1316.         *sv->var = 0L;
  1317.     }
  1318.     }
  1319. }
  1320.  
  1321.  
  1322.  
  1323. \Rogue\Monster\
  1324. else
  1325.   echo "will not over write ./suplib/closelibs.c"
  1326. fi
  1327. if [ `wc -c ./suplib/closelibs.c | awk '{printf $1}'` -ne 406 ]
  1328. then
  1329. echo `wc -c ./suplib/closelibs.c | awk '{print "Got " $1 ", Expected " 406}'`
  1330. fi
  1331. if `test ! -s ./suplib/wildcmp.c`
  1332. then
  1333. echo "writing ./suplib/wildcmp.c"
  1334. cat > ./suplib/wildcmp.c << '\Rogue\Monster\'
  1335.  
  1336. /*
  1337.  * Compare a wild card name with a normal name
  1338.  */
  1339.  
  1340. #define MAXB   8
  1341.  
  1342.  
  1343. wildcmp(wild, name)
  1344. char *wild, *name;
  1345. {
  1346.     register char *w = wild;
  1347.     register char *n = name;
  1348.     char *back[MAXB][2];
  1349.     register short bi = 0;
  1350.     register char c1, c2;
  1351.  
  1352.     while (*n || *w) {
  1353.         switch (*w) {
  1354.         case '*':
  1355.             if (bi == MAXB) {
  1356.                 puts ("Too many levels of '*'");
  1357.                 return (0);
  1358.             }
  1359.             back[bi][0] = w;
  1360.             back[bi][1] = n;
  1361.             ++bi;
  1362.             ++w;
  1363.             continue;
  1364. goback:
  1365.             --bi;
  1366.             while (bi >= 0 && *back[bi][1] == '\0')
  1367.                 --bi;
  1368.             if (bi < 0)
  1369.                 return (0);
  1370.             w = back[bi][0] + 1;
  1371.             n = ++back[bi][1];
  1372.             ++bi;
  1373.             continue;
  1374.         case '?':
  1375.             if (!*n) {
  1376.                 if (bi)
  1377.                     goto goback;
  1378.                 return (0);
  1379.             }
  1380.             break;
  1381.         default:
  1382.             if ((c1 = *n) >= 'A' && c1 <= 'Z')
  1383.                 c1 |= 0x20;
  1384.             if ((c2 = *w) >= 'A' && c2 <= 'Z')
  1385.                 c2 |= 0x20;
  1386.             if (c1 != c2) {
  1387.                 if (bi)
  1388.                     goto goback;
  1389.                 return (0);
  1390.             }
  1391.             break;
  1392.         }
  1393.         if (*n)  ++n;
  1394.         if (*w)  ++w;
  1395.     }
  1396.     return (1);
  1397. }
  1398.  
  1399.  
  1400. \Rogue\Monster\
  1401. else
  1402.   echo "will not over write ./suplib/wildcmp.c"
  1403. fi
  1404. if [ `wc -c ./suplib/wildcmp.c | awk '{printf $1}'` -ne 1360 ]
  1405. then
  1406. echo `wc -c ./suplib/wildcmp.c | awk '{print "Got " $1 ", Expected " 1360}'`
  1407. fi
  1408. if `test ! -s ./suplib/datetos.c`
  1409. then
  1410. echo "writing ./suplib/datetos.c"
  1411. cat > ./suplib/datetos.c << '\Rogue\Monster\'
  1412.  
  1413. /*
  1414.  *  datetos(date, str, ctl)
  1415.  */
  1416.  
  1417. #include <local/typedefs.h>
  1418.  
  1419. static char dim[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
  1420. static char *Month[12] = { "Jan","Feb","Mar","Apr","May","Jun","Jul",
  1421.                "Aug","Sep","Oct","Nov","Dec" };
  1422.  
  1423. char *
  1424. datetos(date, str, ctl)
  1425. DATESTAMP *date;
  1426. char *str;
  1427. char *ctl;
  1428. {
  1429.     long days, years;
  1430.     short leap, month;
  1431.  
  1432.     if (ctl == NULL)
  1433.     ctl = "D M Y h:m:s";
  1434.     days = date->ds_Days + 731;         /*    1976        */
  1435.     years = days / (365*3+366);             /*  #quad yrs   */
  1436.     days -= years * (365*3+366);
  1437.     leap = (days < 366);                    /*  is a leap yr*/
  1438.     years = 1976 + 4 * years;
  1439.     if (!leap) {
  1440.     days -= 366;
  1441.     ++years;
  1442.     }
  1443.     years += days / 365;
  1444.     days -= (days / 365) * 365;
  1445.     for (month = 0; (month==1) ? (days >= 28 + leap) : (days >= dim[month]); ++month)
  1446.     days -= (month==1) ? (28 + leap) : dim[month];
  1447.     {
  1448.     register short i = 0;
  1449.     for (; *ctl; ++ctl) {
  1450.         switch(*ctl) {
  1451.         case 'h':
  1452.         sprintf(str+i, "%02d", date->ds_Minute / 60);
  1453.         break;
  1454.         case 'm':
  1455.         sprintf(str+i, "%02d", date->ds_Minute % 60);
  1456.         break;
  1457.         case 's':
  1458.         sprintf(str+i, "%02d", date->ds_Tick / 50 % 60);
  1459.         break;
  1460.         case 'Y':
  1461.         sprintf(str+i, "%ld", years);
  1462.         break;
  1463.         case 'M':
  1464.         strcpy(str+i, Month[month]);
  1465.         break;
  1466.         case 'D':
  1467.         sprintf(str+i,"%2ld", days+1);
  1468.         break;
  1469.         default:
  1470.         str[i] = *ctl;
  1471.         str[i+1] = 0;
  1472.         break;
  1473.         }
  1474.         i += strlen(str+i);
  1475.     }
  1476.     }
  1477.     return(str);
  1478. }
  1479.  
  1480. \Rogue\Monster\
  1481. else
  1482.   echo "will not over write ./suplib/datetos.c"
  1483. fi
  1484. if [ `wc -c ./suplib/datetos.c | awk '{printf $1}'` -ne 1466 ]
  1485. then
  1486. echo `wc -c ./suplib/datetos.c | awk '{print "Got " $1 ", Expected " 1466}'`
  1487. fi
  1488. if `test ! -s ./suplib/checkbreak.c`
  1489. then
  1490. echo "writing ./suplib/checkbreak.c"
  1491. cat > ./suplib/checkbreak.c << '\Rogue\Monster\'
  1492.  
  1493. /*
  1494.  * CHECKBREAK()
  1495.  *
  1496.  *    Return    1 = break pressed,
  1497.  *        0 = break not pressed
  1498.  */
  1499.  
  1500. #define SBF  (SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D)
  1501.  
  1502. checkbreak()
  1503. {
  1504.     return(SetSignal(0,0) & SBF);
  1505. }
  1506.  
  1507. \Rogue\Monster\
  1508. else
  1509.   echo "will not over write ./suplib/checkbreak.c"
  1510. fi
  1511. if [ `wc -c ./suplib/checkbreak.c | awk '{printf $1}'` -ne 185 ]
  1512. then
  1513. echo `wc -c ./suplib/checkbreak.c | awk '{print "Got " $1 ", Expected " 185}'`
  1514. fi
  1515. if `test ! -s ./suplib/bcmp.asm`
  1516. then
  1517. echo "writing ./suplib/bcmp.asm"
  1518. cat > ./suplib/bcmp.asm << '\Rogue\Monster\'
  1519.  
  1520.         public    _bcmp        ; compare two blocks of memory
  1521.  
  1522.         ;   BCMP(src, dst, len)
  1523.  
  1524. _bcmp:        move.l    4(sp),A0
  1525.         move.l    8(sp),A1
  1526.         move.l    12(sp),D0
  1527.         beq    .bcsucc
  1528.         cmp.w    D0,D0        ; set Z bit.
  1529.         bra    .bc2
  1530. .bc1        cmpm.b    (A0)+,(A1)+
  1531. .bc2        dbne    D0,.bc1
  1532.         bne    .bcfail
  1533.         sub.l    #$10000,D0
  1534.         bcc    .bc1
  1535. .bcsucc     moveq.l #1,D0
  1536.         rts
  1537. .bcfail     moveq.l #0,D0
  1538.         rts
  1539.  
  1540.  
  1541.         ;   OLD BCMP HAD BUGS ... alignment problems.
  1542.         ;
  1543.  
  1544. ;         move.w  D0,D1         ;longword align address
  1545. ;         neg.w     D1
  1546. ;         and.w     #3,D1
  1547. ;         cmp.w     D0,D0         ;force Z bit
  1548. ;         bra     .bc2
  1549. ;.bc1         cmpm.b  (A0)+,(A1)+
  1550. ;.bc2         dbne     D1,.bc1
  1551. ;         bne     .bcfail
  1552. ;         move.l  D0,D1
  1553. ;         lsr.l     #2,D1         ;# of longwords to compare
  1554. ;         cmp.w     D0,D0         ;force Z bit
  1555. ;         bra     .bc11
  1556. ;.bc10         cmpm.l  (A0)+,(A1)+
  1557. ;.bc11         dbne     D1,.bc10
  1558. ;         bne     .bcfail
  1559. ;         sub.l     #$10000,D0
  1560. ;         bcc     .bc10
  1561. ;         and.w     #3,D0         ;remaining bytes to compare
  1562. ;         cmp.w     D0,D0         ;force Z bit
  1563. ;         bra     .bc21
  1564. ;.bc20         cmpm.b  (A0)+,(A1)+
  1565. ;.bc21         dbne     D0,.bc20
  1566. ;         bne     .bcfail
  1567. ;         moveq.l #1,D0         ;success!
  1568. ;         rts
  1569. ;.bcfail     moveq.l #0,D0         ;failure!
  1570. ;         rts
  1571.  
  1572. \Rogue\Monster\
  1573. else
  1574.   echo "will not over write ./suplib/bcmp.asm"
  1575. fi
  1576. if [ `wc -c ./suplib/bcmp.asm | awk '{printf $1}'` -ne 1074 ]
  1577. then
  1578. echo `wc -c ./suplib/bcmp.asm | awk '{print "Got " $1 ", Expected " 1074}'`
  1579. fi
  1580. if `test ! -s ./suplib/bmov.asm`
  1581. then
  1582. echo "writing ./suplib/bmov.asm"
  1583. cat > ./suplib/bmov.asm << '\Rogue\Monster\'
  1584.  
  1585.         ;   BMOV(src, dst, len)
  1586.         ;
  1587.         ;   The memory move algorithm is somewhat more of a mess
  1588.         ;   since we must do it either ascending or decending.
  1589.  
  1590.         public    _bmov
  1591. _bmov:        move.l    4(sp),A0
  1592.         move.l    8(sp),A1
  1593.         move.l    12(sp),D0
  1594.         cmp.l    A0,A1        ;move to self
  1595.         beq    .bmend
  1596.         bls    .bmup
  1597. .bmdown     adda.l    D0,A0        ;descending copy
  1598.         adda.l    D0,A1
  1599.         move.w    A0,D1        ;CHECK WORD ALIGNED
  1600.         btst.l    #0,D1
  1601.         bne    .bmdown1
  1602.         move.w    A1,D1
  1603.         btst.l    #0,D1
  1604.         bne    .bmdown1
  1605.         cmp.l    #259,D0         ;chosen by calculation.
  1606.         blo    .bmdown8
  1607.  
  1608.         move.l    D0,D1            ;overhead for bmd44: ~360
  1609.         divu    #44,D1
  1610.         bvs    .bmdown8        ;too big (> 2,883,540)
  1611.         movem.l D2-D7/A2-A6,-(sp)   ;use D2-D7/A2-A6 (11 regs)
  1612.         move.l    #11*4,D0
  1613.         bra    .bmd44b
  1614. .bmd44a     sub.l    D0,A0            ;8        total 214/44bytes
  1615.         movem.l (A0),D2-D7/A2-A6    ;12 + 8*11  4.86 cycles/byte
  1616.         movem.l D2-D7/A2-A6,-(A1)   ; 8 + 8*11
  1617. .bmd44b     dbf    D1,.bmd44a        ;10
  1618.         swap    D1            ;D0<15:7> already contain 0
  1619.         move.w    D1,D0            ;D0 = remainder
  1620.         movem.l (sp)+,D2-D7/A2-A6
  1621.  
  1622. .bmdown8    move.w    D0,D1            ;D1<2:0> = #bytes left later
  1623.         lsr.l    #3,D0            ;divide by 8
  1624.         bra    .bmd8b
  1625. .bmd8a        move.l    -(A0),-(A1)         ;20         total 50/8bytes
  1626.         move.l    -(A0),-(A1)         ;20         = 6.25 cycles/byte
  1627. .bmd8b        dbf    D0,.bmd8a        ;10
  1628.         sub.l    #$10000,D0
  1629.         bcc    .bmd8a
  1630.         move.w    D1,D0            ;D0 = 0 to 7 bytes
  1631.         and.l    #7,D0
  1632.         bne    .bmdown1
  1633.         rts
  1634.  
  1635. .bmd1a        move.b    -(A0),-(A1)         ;12         total 22/byte
  1636. .bmdown1                    ;        = 22 cycles/byte
  1637. .bmd1b        dbf    D0,.bmd1a        ;10
  1638.         sub.l    #$10000,D0
  1639.         bcc    .bmd1a
  1640.         rts
  1641.  
  1642. .bmup        move.w    A0,D1            ;CHECK WORD ALIGNED
  1643.         btst.l    #0,D1
  1644.         bne    .bmup1
  1645.         move.w    A1,D1
  1646.         btst.l    #0,D1
  1647.         bne    .bmup1
  1648.         cmp.l    #259,D0         ;chosen by calculation
  1649.         blo    .bmup8
  1650.  
  1651.         move.l    D0,D1            ;overhead for bmu44: ~360
  1652.         divu    #44,D1
  1653.         bvs    .bmup8            ;too big (> 2,883,540)
  1654.         movem.l D2-D7/A2-A6,-(sp)   ;use D2-D7/A2-A6 (11 regs)
  1655.         move.l    #11*4,D0
  1656.         bra    .bmu44b
  1657. .bmu44a     movem.l (A0)+,D2-D7/A2-A6   ;12 + 8*11  ttl 214/44bytes
  1658.         movem.l D2-D7/A2-A6,(A1)    ;8  + 8*11  4.86 cycles/byte
  1659.         add.l    D0,A1            ;8
  1660. .bmu44b     dbf    D1,.bmu44a        ;10
  1661.         swap    D1            ;D0<15:7> already contain 0
  1662.         move.w    D1,D0            ;D0 = remainder
  1663.         movem.l (sp)+,D2-D7/A2-A6
  1664.  
  1665. .bmup8        move.w    D0,D1            ;D1<2:0> = #bytes left later
  1666.         lsr.l    #3,D0            ;divide by 8
  1667.         bra    .bmu8b
  1668. .bmu8a        move.l    (A0)+,(A1)+         ;20         total 50/8bytes
  1669.         move.l    (A0)+,(A1)+         ;20         = 6.25 cycles/byte
  1670. .bmu8b        dbf    D0,.bmu8a        ;10
  1671.         sub.l    #$10000,D0
  1672.         bcc    .bmu8a
  1673.         move.w    D1,D0            ;D0 = 0 to 7 bytes
  1674.         and.l    #7,D0
  1675.         bne    .bmup1
  1676.         rts
  1677.  
  1678. .bmu1a        move.b    (A0)+,(A1)+
  1679. .bmup1
  1680. .bmu1b        dbf    D0,.bmu1a
  1681.         sub.l    #$10000,D0
  1682.         bcc    .bmu1a
  1683. .bmend        rts
  1684.  
  1685.  
  1686. \Rogue\Monster\
  1687. else
  1688.   echo "will not over write ./suplib/bmov.asm"
  1689. fi
  1690. if [ `wc -c ./suplib/bmov.asm | awk '{printf $1}'` -ne 2621 ]
  1691. then
  1692. echo `wc -c ./suplib/bmov.asm | awk '{print "Got " $1 ", Expected " 2621}'`
  1693. fi
  1694. if `test ! -s ./suplib/semaphore.c`
  1695. then
  1696. echo "writing ./suplib/semaphore.c"
  1697. cat > ./suplib/semaphore.c << '\Rogue\Monster\'
  1698.  
  1699. /*
  1700.  *  The bindings for the following semaphore functions are incorrect
  1701.  *  in the lattice/manx 1.2 clibs:
  1702.  *
  1703.  *    RemSemaphore
  1704.  *    FindSemaphore
  1705.  *    AddSemaphore
  1706.  */
  1707.  
  1708. #include <local/typedefs.h>
  1709.  
  1710. #asm
  1711.         public    _LVOFindSemaphore
  1712.         public    _LVORemSemaphore
  1713.         public    _SysBase
  1714.         public    _RemSemaphore
  1715.         public    _FindSemaphore
  1716.  
  1717. _RemSemaphore:    move.l    4(sp),A1
  1718.         move.l    _SysBase,A6
  1719.         jmp    _LVORemSemaphore(A6)
  1720.  
  1721. _FindSemaphore: move.l    4(sp),A1
  1722.         move.l    _SysBase,A6
  1723.         jmp    _LVOFindSemaphore(A6)
  1724.  
  1725. #endasm
  1726.  
  1727. extern EXECBASE *SysBase;
  1728.  
  1729. AddSemaphore(ss)
  1730. SIGSEM *ss;
  1731. {
  1732.     InitSemaphore(ss);
  1733.     Forbid();
  1734.     Enqueue(&SysBase->SemaphoreList,ss);
  1735.     Permit();
  1736. }
  1737.  
  1738.  
  1739.  
  1740. \Rogue\Monster\
  1741. else
  1742.   echo "will not over write ./suplib/semaphore.c"
  1743. fi
  1744. if [ `wc -c ./suplib/semaphore.c | awk '{printf $1}'` -ne 644 ]
  1745. then
  1746. echo `wc -c ./suplib/semaphore.c | awk '{print "Got " $1 ", Expected " 644}'`
  1747. fi
  1748. if `test ! -s ./suplib/llink.c`
  1749. then
  1750. echo "writing ./suplib/llink.c"
  1751. cat > ./suplib/llink.c << '\Rogue\Monster\'
  1752.  
  1753. #include <local/xmisc.h>
  1754.  
  1755. XLIST *
  1756. llink(list, en)
  1757. register XLIST *en, **list;
  1758. {
  1759.     en->next = *list;
  1760.     en->prev = list;
  1761.     *list = en;
  1762.     if (en->next)
  1763.     en->next->prev = &en->next;
  1764.     return(en);
  1765. }
  1766.  
  1767. \Rogue\Monster\
  1768. else
  1769.   echo "will not over write ./suplib/llink.c"
  1770. fi
  1771. if [ `wc -c ./suplib/llink.c | awk '{printf $1}'` -ne 206 ]
  1772. then
  1773. echo `wc -c ./suplib/llink.c | awk '{print "Got " $1 ", Expected " 206}'`
  1774. fi
  1775. if `test ! -s ./suplib/openlibs.c`
  1776. then
  1777. echo "writing ./suplib/openlibs.c"
  1778. cat > ./suplib/openlibs.c << '\Rogue\Monster\'
  1779.  
  1780. #include <local/xmisc.h>
  1781.  
  1782. static long OpenMask = 0;
  1783.  
  1784. long GfxBase;
  1785. long IntuitionBase;
  1786. long ExpansionBase;
  1787. long DiskfontBase;
  1788. long TranslatorBase;
  1789. long IconBase;
  1790. long MathBase;
  1791. long MathTransBase;
  1792. long MathIeeeDoubBasBase;
  1793. long MathIeeeSingBasBase;
  1794. long LayersBase;
  1795. long ClistBase;
  1796. long PotgoBase;
  1797. long TimerBase;
  1798. long DResBase;
  1799. long xfiller15;
  1800.  
  1801. struct OLI {
  1802.     char *name;
  1803.     long *var;
  1804. };
  1805.  
  1806. struct OLI strvar[] = {
  1807.   "graphics",           &GfxBase,
  1808.   "intuition",          &IntuitionBase,
  1809.   "expansion",          &ExpansionBase,
  1810.   "diskfont",           &DiskfontBase,
  1811.   "translator",         &TranslatorBase,
  1812.   "icon",               &IconBase,
  1813.   "mathffp",            &MathBase,
  1814.   "mathtrans",          &MathTransBase,
  1815.   "mathieeedoubbas",    &MathIeeeDoubBasBase,
  1816.   "mathieeesingbas",    &MathIeeeSingBasBase,
  1817.   "layers",             &LayersBase,
  1818.   "clist",              &ClistBase,
  1819.   "potgo",              &PotgoBase,
  1820.   "timer",              &TimerBase,
  1821.   "dres",               &DResBase,
  1822.   "x15",                &xfiller15
  1823. };
  1824.  
  1825.  
  1826. openlibs(mask)
  1827. unsigned short mask;
  1828. {
  1829.     register struct OLI *sv;
  1830.     register short i;
  1831.     char buf[64];
  1832.  
  1833.     for (i = 0; i < sizeof(strvar)/sizeof(strvar[0]); ++i) {
  1834.     sv = strvar + i;
  1835.     if (mask & (1 << i)) {
  1836.         strcpy(buf, sv->name);
  1837.         strcat(buf, ".library");
  1838.         if (*sv->var == 0 && (*sv->var = OpenLibrary(buf, 0L)) == 0) {
  1839.         closelibs(mask);
  1840.         return(0);
  1841.         }
  1842.         OpenMask |= 1 << i;
  1843.     }
  1844.     }
  1845.     return(1);
  1846. }
  1847.  
  1848. /*
  1849.  * CLOSELIBS(mask)
  1850.  *
  1851.  *    Close the indicated libraries.    Does not close libraries which
  1852.  *    have not been openned with OPENLIBS()
  1853.  */
  1854.  
  1855. closelibs(mask)
  1856. unsigned short mask;
  1857. {
  1858.     register struct OLI *sv;
  1859.     register short i;
  1860.  
  1861.     for (i = 0; i < sizeof(strvar)/sizeof(strvar[0]); ++i) {
  1862.     sv = strvar + i;
  1863.     if ((mask & (1 << i)) && *sv->var && (OpenMask & (1 << i))) {
  1864.         CloseLibrary(*sv->var);
  1865.         *sv->var = 0L;
  1866.         OpenMask &= ~(1 << i);
  1867.     }
  1868.     }
  1869. }
  1870.  
  1871. \Rogue\Monster\
  1872. else
  1873.   echo "will not over write ./suplib/openlibs.c"
  1874. fi
  1875. if [ `wc -c ./suplib/openlibs.c | awk '{printf $1}'` -ne 1921 ]
  1876. then
  1877. echo `wc -c ./suplib/openlibs.c | awk '{print "Got " $1 ", Expected " 1921}'`
  1878. fi
  1879. if `test ! -s ./suplib/dead.c`
  1880. then
  1881. echo "writing ./suplib/dead.c"
  1882. cat > ./suplib/dead.c << '\Rogue\Monster\'
  1883.  
  1884. /*
  1885.  *
  1886.  *
  1887.  */
  1888.  
  1889.  
  1890. DeadKeyConvert(msg,buf,bufsize,keymap)
  1891. struct IntuiMessage *msg;
  1892. UBYTE *buf;
  1893. int bufsize;
  1894. struct KeyMap *keymap;
  1895. {
  1896.     static struct InputEvent ievent = { NULL, IECLASS_RAWKEY };
  1897.     if (msg->Class != RAWKEY)
  1898.     return(-2);
  1899.     ievent.ie_Code = msg->Code;
  1900.     ievent.ie_Qualifier = msg->Qualifier;
  1901.     ievent.ie_position.ie_addr = *((APTR *)msg->IAddress);
  1902.     return(RawKeyConvert(&ievent,buf,bufsize,keymap));
  1903. }
  1904.  
  1905. \Rogue\Monster\
  1906. else
  1907.   echo "will not over write ./suplib/dead.c"
  1908. fi
  1909. if [ `wc -c ./suplib/dead.c | awk '{printf $1}'` -ne 429 ]
  1910. then
  1911. echo `wc -c ./suplib/dead.c | awk '{print "Got " $1 ", Expected " 429}'`
  1912. fi
  1913. if `test ! -s ./suplib/getfont.c`
  1914. then
  1915. echo "writing ./suplib/getfont.c"
  1916. cat > ./suplib/getfont.c << '\Rogue\Monster\'
  1917.  
  1918. /*
  1919.  *  This function properly searches resident and disk fonts for the
  1920.  *  font.
  1921.  *
  1922.  */
  1923.  
  1924. #include <local/typedefs.h>
  1925. #include <local/xmisc.h>
  1926.  
  1927. extern long DiskfontBase;
  1928.  
  1929. FONT *
  1930. GetFont(name, size)
  1931. char *name;
  1932. short size;
  1933. {
  1934.     register FONT *font1;
  1935.     TA Ta;
  1936.     short libwasopen = (DiskfontBase != NULL);
  1937.  
  1938.     Ta.ta_Name    = (ubyte *)name;
  1939.     Ta.ta_YSize = size;
  1940.     Ta.ta_Style = 0;
  1941.     Ta.ta_Flags = 0;
  1942.  
  1943.     font1 = OpenFont(&Ta);
  1944.     if (font1 == NULL || font1->tf_YSize != Ta.ta_YSize) {
  1945.     register FONT *font2;
  1946.  
  1947.     if (openlibs(DISKFONT_LIB)) {
  1948.         if (font2 = OpenDiskFont(&Ta)) {
  1949.         if (font1)
  1950.             CloseFont(font1);
  1951.         font1 = font2;
  1952.         }
  1953.         if (!libwasopen)
  1954.         closelibs(DISKFONT_LIB);
  1955.     }
  1956.     }
  1957.     return(font1);
  1958. }
  1959.  
  1960. \Rogue\Monster\
  1961. else
  1962.   echo "will not over write ./suplib/getfont.c"
  1963. fi
  1964. if [ `wc -c ./suplib/getfont.c | awk '{printf $1}'` -ne 728 ]
  1965. then
  1966. echo `wc -c ./suplib/getfont.c | awk '{print "Got " $1 ", Expected " 728}'`
  1967. fi
  1968. if `test ! -s ./suplib/Makefile`
  1969. then
  1970. echo "writing ./suplib/Makefile"
  1971. cat > ./suplib/Makefile << '\Rogue\Monster\'
  1972.  
  1973. #   Aztec C V3.6 Makefile for sup32.lib, A link-time support library
  1974. #   Required to compile most of my sources (DME, etc...)
  1975. #
  1976. #   Some modifications might be required.  I am not sure if the 3.4 Make
  1977. #   support output redirection.
  1978.  
  1979.  
  1980.  
  1981. SYMS=    include:symbols.m
  1982. SYMC=    include:local/makesymbols.c
  1983. SYMR=    T:symbols.m
  1984.  
  1985. DEST = clib:sup32.lib
  1986. CFLAGS = +BCDL +I$(SYMR)
  1987. AFLAGS =
  1988.  
  1989. SR01 = checkbreak.c
  1990. SR02 = dio.c
  1991. SR03 = break.c
  1992. SR04 = scandir.c
  1993. SR05 = initdeemunw.c
  1994. SR06 = mntreq.c
  1995. SR07 = openlibs.c
  1996. SR08 = resetbreak.c
  1997. SR09 = asyncop.c
  1998. SR10 = getfont.c
  1999. SR11 = wildcmp.c
  2000. SR12 = bcmp.asm
  2001. SR13 = bmov.asm
  2002. SR14 = bset.asm
  2003. SR15 = fhprintf.asm
  2004. SR16 = xfio.c
  2005. SR17 = conwin.c
  2006. SR18 = semaphore.c
  2007. SR19 = resource.asm
  2008. SR20 = llink.c
  2009. SR21 = lunlink.c
  2010. SR22 = setfiledate.c
  2011. SR23 = datetos.c
  2012. SR24 = enviroment.c
  2013. SR25 = dead.c
  2014.  
  2015. OB01 = T:checkbreak.o
  2016. OB02 = T:dio.o
  2017. OB03 = T:break.o
  2018. OB04 = T:scandir.o
  2019. OB05 = T:initdeemunw.o
  2020. OB06 = T:mntreq.o
  2021. OB07 = T:openlibs.o
  2022. OB08 = T:resetbreak.o
  2023. OB09 = T:asyncop.o
  2024. OB10 = T:getfont.o
  2025. OB11 = T:wildcmp.o
  2026. OB12 = T:bcmp.o
  2027. OB13 = T:bmov.o
  2028. OB14 = T:bset.o
  2029. OB15 = T:fhprintf.o
  2030. OB16 = T:xfio.o
  2031. OB17 = T:conwin.o
  2032. OB18 = T:semaphore.o
  2033. OB19 = T:resource.o
  2034. OB20 = T:llink.o
  2035. OB21 = T:lunlink.o
  2036. OB22 = T:setfiledate.o
  2037. OB23 = T:datetos.o
  2038. OB24 = T:enviroment.o
  2039. OB25 = T:dead.o
  2040.  
  2041. SRC1 =           $(SR01) $(SR02) $(SR03) $(SR04)
  2042. SRC2 = $(SR05) $(SR06) $(SR07) $(SR08) $(SR09)
  2043. SRC3 = $(SR10) $(SR11) $(SR12) $(SR13) $(SR14)
  2044. SRC4 = $(SR15) $(SR16) $(SR17) $(SR18) $(SR19)
  2045. SRC5 = $(SR20) $(SR21) $(SR22) $(SR23) $(SR24)
  2046. SRC6 = $(SR25)
  2047.  
  2048. OBJ1 =           $(OB01) $(OB02) $(OB03) $(OB04)
  2049. OBJ2 = $(OB05) $(OB06) $(OB07) $(OB08) $(OB09)
  2050. OBJ3 = $(OB10) $(OB11) $(OB12) $(OB13) $(OB14)
  2051. OBJ4 = $(OB15) $(OB16) $(OB17) $(OB18) $(OB19)
  2052. OBJ5 = $(OB20) $(OB21) $(OB22) $(OB23) $(OB24)
  2053. OBJ6 = $(OB25)
  2054.  
  2055.  
  2056. all:    $(SYMR) $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6)
  2057.     -delete $(DEST)
  2058.     Echo "$(OBJ1)" >T:ORD1
  2059.     Echo "$(OBJ2)" >T:ORD2
  2060.     Echo "$(OBJ3)" >T:ORD3
  2061.     Echo "$(OBJ4)" >T:ORD4
  2062.     Echo "$(OBJ5)" >T:ORD5
  2063.     Echo "$(OBJ6)" >T:ORD6
  2064.     Join T:ORD1 T:ORD2 T:ORD3 T:ORD4 T:ORD5 T:ORD6 AS T:ORDIN
  2065.     Ord T:ORDIN T:ORDOUT
  2066.     Lb $(DEST) -f T:ORDOUT
  2067.     delete T:ORDIN T:ORDOUT T:ORD1 T:ORD2 T:ORD3 T:ORD4 T:ORD5 T:ORD6
  2068.  
  2069.  
  2070. clean:
  2071.     -delete $(OBJ1)
  2072.     -delete $(OBJ2)
  2073.     -delete $(OBJ3)
  2074.     -delete $(OBJ4)
  2075.     -delete $(OBJ5)
  2076.     -delete $(OBJ6)
  2077.  
  2078. $(OB01) : $(SR01)
  2079.     cc $(CFLAGS) $(SR01) -o $(OB01)
  2080. $(OB02) : $(SR02)
  2081.     cc $(CFLAGS) $(SR02) -o $(OB02)
  2082. $(OB03) : $(SR03)
  2083.     cc $(CFLAGS) $(SR03) -o $(OB03)
  2084. $(OB04) : $(SR04)
  2085.     cc $(CFLAGS) $(SR04) -o $(OB04)
  2086. $(OB05) : $(SR05)
  2087.     cc $(CFLAGS) $(SR05) -o $(OB05)
  2088. $(OB06) : $(SR06)
  2089.     cc $(CFLAGS) $(SR06) -o $(OB06)
  2090. $(OB07) : $(SR07)
  2091.     cc $(CFLAGS) $(SR07) -o $(OB07)
  2092. $(OB08) : $(SR08)
  2093.     cc $(CFLAGS) $(SR08) -o $(OB08)
  2094. $(OB09) : $(SR09)
  2095.     cc $(CFLAGS) $(SR09) -o $(OB09)
  2096. $(OB10) : $(SR10)
  2097.     cc $(CFLAGS) $(SR10) -o $(OB10)
  2098. $(OB11) : $(SR11)
  2099.     cc $(CFLAGS) $(SR11) -o $(OB11)
  2100. $(OB12) : $(SR12)
  2101.     as $(AFLAGS) $(SR12) -o $(OB12)
  2102. $(OB13) : $(SR13)
  2103.     as $(AFLAGS) $(SR13) -o $(OB13)
  2104. $(OB14) : $(SR14)
  2105.     as $(AFLAGS) $(SR14) -o $(OB14)
  2106. $(OB15) : $(SR15)
  2107.     as $(AFLAGS) $(SR15) -o $(OB15)
  2108. $(OB16) : $(SR16)
  2109.     cc $(CFLAGS) $(SR16) -o $(OB16)
  2110. $(OB17) : $(SR17)
  2111.     cc $(CFLAGS) $(SR17) -o $(OB17)
  2112. $(OB18) : $(SR18)
  2113.     cc $(CFLAGS) $(SR18) -o $(OB18)
  2114. $(OB19) : $(SR19)
  2115.     as $(AFLAGS) $(SR19) -o $(OB19)
  2116. $(OB20) : $(SR20)
  2117.     cc $(CFLAGS) $(SR20) -o $(OB20)
  2118. $(OB21) : $(SR21)
  2119.     cc $(CFLAGS) $(SR21) -o $(OB21)
  2120. $(OB22) : $(SR22)
  2121.     cc $(CFLAGS) $(SR22) -o $(OB22)
  2122. $(OB23) : $(SR23)
  2123.     cc $(CFLAGS) $(SR23) -o $(OB23)
  2124. $(OB24) : $(SR24)
  2125.     cc $(CFLAGS) $(SR24) -o $(OB24)
  2126. $(OB25) : $(SR25)
  2127.     cc $(CFLAGS) $(SR25) -o $(OB25)
  2128.  
  2129. $(SYMS):    $(SYMC)
  2130.     make -f include:local/Makefile
  2131.  
  2132. $(SYMR):    $(SYMS)
  2133.     Copy $(SYMS) $(SYMR)
  2134.  
  2135. \Rogue\Monster\
  2136. else
  2137.   echo "will not over write ./suplib/Makefile"
  2138. fi
  2139. if [ `wc -c ./suplib/Makefile | awk '{printf $1}'` -ne 3737 ]
  2140. then
  2141. echo `wc -c ./suplib/Makefile | awk '{print "Got " $1 ", Expected " 3737}'`
  2142. fi
  2143. if `test ! -d ./suplib/AUX`
  2144. then
  2145.   mkdir ./suplib/AUX
  2146.   echo "mkdir ./suplib/AUX"
  2147. fi
  2148. if `test ! -s ./suplib/AUX/qint_test.c`
  2149. then
  2150. echo "writing ./suplib/AUX/qint_test.c"
  2151. cat > ./suplib/AUX/qint_test.c << '\Rogue\Monster\'
  2152.  
  2153. /*
  2154.  *  QINT TEST ROUTINE
  2155.  *
  2156.  *  1> test
  2157.  *        Ctl D   -quit
  2158.  *        Ctl E   -cause test interrupt #1
  2159.  *        Ctl F   -cause test interrupt #0
  2160.  *
  2161.  *        (see printf's to understand what it is printing)
  2162.  *
  2163.  *    Basic idea: Cycle through various priorities.  The Q interrupts
  2164.  *    are both set for priority 16, and thus only work when the counter
  2165.  *    is 0...15
  2166.  *
  2167.  *    If you set one of the Q interrupts to, say, 17, you would then
  2168.  *    have to worry about the level 17 Q interrupt interrupting the
  2169.  *    level 16 interrupt, and thus surround the level 16 interrupt
  2170.  *    with:
  2171.  *        char oldpri = SetQPri(127);
  2172.  *        puts("blah");
  2173.  *        SetQPri(oldpri);
  2174.  *
  2175.  *    As it is, with both at level 16, they cannot interrupt each other
  2176.  *    (if one occurs while the other is running, it is queued till the
  2177.  *     other one finishes).
  2178.  */
  2179.  
  2180. #include <exec/types.h>
  2181. #include <exec/tasks.h>
  2182.  
  2183. typedef struct Task TASK;
  2184.  
  2185. extern TASK *FindTask();
  2186.  
  2187. int X;
  2188. int Enable_Abort;
  2189.  
  2190. void
  2191. myhan(sig)
  2192. {
  2193.     ++X;
  2194.     printf("test# %ld\n", sig);
  2195. }
  2196.  
  2197. main()
  2198. {
  2199.     short i;
  2200.     int j;
  2201.  
  2202.     Enable_Abort = 0;
  2203.  
  2204.     printf("tcexcept: %08lx\n", FindTask(NULL)->tc_ExceptCode);
  2205.     SetQVector(SIGBREAKB_CTRL_F, myhan, 0, 16);
  2206.     SetQVector(SIGBREAKB_CTRL_E, myhan, 1, 16);
  2207.     printf("tcexcept: %08lx\n", FindTask(NULL)->tc_ExceptCode);
  2208.     printf("tcexmask: %08lx\n", FindTask(NULL)->tc_SigExcept);
  2209.     for (i = 0; ; ++i) {
  2210.     i &= 31;
  2211.     SetQPri(127);
  2212.     printf("i = %2ld rcvd: %08lx  excp: %08lx  cnt: %6ld\n", i,
  2213.         FindTask(NULL)->tc_SigRecvd, FindTask(NULL)->tc_SigExcept,
  2214.         X
  2215.     );
  2216.     SetQPri(i);
  2217.     for (j = 0; j < 100; ++j);
  2218.     if (SetSignal(0,SIGBREAKF_CTRL_D) & SIGBREAKF_CTRL_D)
  2219.         break;
  2220.     }
  2221.     SetQVector(SIGBREAKB_CTRL_E, NULL, 0, 0);
  2222.     SetQVector(SIGBREAKB_CTRL_F, NULL, 0, 0);
  2223.     puts("exiting");
  2224.     printf("tcexcept: %08lx\n", FindTask(NULL)->tc_ExceptCode);
  2225. }
  2226.  
  2227. \Rogue\Monster\
  2228. else
  2229.   echo "will not over write ./suplib/AUX/qint_test.c"
  2230. fi
  2231. if [ `wc -c ./suplib/AUX/qint_test.c | awk '{printf $1}'` -ne 1824 ]
  2232. then
  2233. echo `wc -c ./suplib/AUX/qint_test.c | awk '{print "Got " $1 ", Expected " 1824}'`
  2234. fi
  2235. if `test ! -s ./suplib/fhprintf.asm`
  2236. then
  2237. echo "writing ./suplib/fhprintf.asm"
  2238. cat > ./suplib/fhprintf.asm << '\Rogue\Monster\'
  2239.  
  2240. ;FHPRINTF.ASM
  2241. ;
  2242. ;  Handles formatted printing to Amiga file handles   w/ fhprintf
  2243.  
  2244. ;
  2245. ;   Manx assembler FAR stmts.
  2246.  
  2247.     FAR code
  2248.     FAR data
  2249.  
  2250.     xdef  _fhprintf
  2251.     xref  _Write
  2252.     xref  _LVORawDoFmt
  2253.     xref  _SysBase
  2254.  
  2255. _fhprintf
  2256.     jsr     xformat   ;same thing
  2257.     jsr     _Write
  2258.     lea.l     268(A7),A7
  2259.     rts
  2260.  
  2261.     ;XFORMAT takes a Xprintf(xx, cs, arg, arg...)  where xx is any
  2262.     ;integer and returns (xx, buf, bytes) on the stack suitable for an
  2263.     ;immediate call to xwrite() or Write().  The caller must deallocate
  2264.     ;268 bytes from the stack when done.
  2265.     ;
  2266.     ;      (oret)
  2267.     ;  A2 A3 A4 A5 A6 RET FI BUF NUM <thebuffer> printfret fi cs args
  2268.     ;  ^   ^     ^
  2269.     ;  1   2     3
  2270.  
  2271.  
  2272. xformat
  2273.     move.l     A7,A0        ;sp now at pos. #3  A0 = pos #3
  2274.     sub.l     #268,A7    ;sp now at pos. #2  SP = pos #2
  2275.     move.l     (A0),(A7)      ;copy return address
  2276.     move.l     8(A0),4(A7)    ;copy fi or fh  to FI
  2277.     lea.l     16(A7),A1      ;address of buffer
  2278.     move.l     A1,8(A7)       ;place in     BUF
  2279.     movem.l  A2-A6,-(A7)    ;save regs   SP = pos #1
  2280.     move.l     A1,A3        ;A3 = buffer pointer
  2281.     lea.l     16(A0),A1      ;A1 = lea of printf arg list
  2282.     move.l     12(A0),A0      ;A0 = control string
  2283.     move.l     #_xc,A2    ;A2 = call vector
  2284.  
  2285.     move.l     _SysBase,A6    ;exec library call
  2286.     jsr     _LVORawDoFmt(A6)
  2287.  
  2288.     move.l     28(A7),A3      ;buffer start
  2289. loop    tst.b     (A3)+          ;find end of string
  2290.     bne     loop
  2291.     sub.l     28(A7),A3      ;get string length
  2292.     subq.l     #1,A3
  2293.     move.l     A3,32(A7)      ;place in     NUM
  2294.     movem.l  (A7)+,A2-A6    ;restore registers used
  2295.     rts
  2296.  
  2297. _xc
  2298.     move.b     D0,(A3)+
  2299.     rts
  2300.  
  2301.  
  2302. \Rogue\Monster\
  2303. else
  2304.   echo "will not over write ./suplib/fhprintf.asm"
  2305. fi
  2306. if [ `wc -c ./suplib/fhprintf.asm | awk '{printf $1}'` -ne 1473 ]
  2307. then
  2308. echo `wc -c ./suplib/fhprintf.asm | awk '{print "Got " $1 ", Expected " 1473}'`
  2309. fi
  2310. echo "Finished archive 2 of 2"
  2311. # if you want to concatenate archives, remove anything after this line
  2312. exit
  2313. -- 
  2314. Bob Page, U of Lowell CS Dept.  page@swan.ulowell.edu  ulowell!page
  2315. Have five nice days.
  2316.